I run a Macintosh with a MacHTTP web server and an Apple Internet Mail Server in my office, and there are times I’d just like to peek at the Mac’s screen. However, I don’t like waiting for that machine’s monitor to warm up. Even worse, I recently had to borrow that machine’s monitor for another machine. My solution?
I wrote this CGI application in CodeWarrior C that takes a screenshot of the current Macintosh screen, converts it to a GIF image, and returns it to your Web browser.
I used Grant Neufeld’s excellent framework (Grant's CGI Framework 1.0b10).
Installation
To install the program, just copy it to the same folder you use for your other CGI scripts and applications (or make a new one...it doesn’t matter where you put it). You should give the program a unique name unless you want everybody on the WWW to be peeking at your server’s screen!
Use
In your web browser, type the following URL:
http://<your server name here>/<the program's folder>/<the program's name>
For example, if your server is www.goofball.com, your CGI folder is called MyCGIs and you named my program capture_it.acgi, you would use the following URL:
http://www.goofball.com/MyCGIs/capture_it.acgi
Some notes about the current version (version 0.3)
• This version returns only a GIF image. Thanks to Eric A. Perlman (eric@yikes.com) for the suggestion (and the instructions!).
• This version is once again a fat binary. It’s been tested on quite a few Power Macintosh models and it works just fine. I think I’ve figured out the problems (thanks to some help out there!).
• The program is hard-coded to generate a 256-color, 640*480 GIF image. If your display’s something other than that, it’ll try to dither the image for the best possible quality.
• It takes anywhere from 2 to 10 seconds (or more?) to generate the GIF image, so be patient.
A note about Netscape (and other browsers?) caches
• It is entirely possible that your browser will cache ServerScreenCapture's GIF image, causing it to appear out-of-date. You can hit option-Reload in Netscape and it'll completely flush its cache. I added a Pragma: no cache directive to the http header, but it doesn’t seem to help Netscape (sigh).